
//#include "..\SystemInitialData\SystemInformation.h"



/***********************************************
 * not put the data in memory
 * this is for SOC function to use
 ***********************************************/
//#define SOC_BATTERY_OV_VOLTAGE     __2ND_BATTERY_OV_PROTECTION_     //5600
//#define SOC_BATTERY_UV_VOLTAGE     __2ND_BATTERY_UV_PROTECTION_     //3700
//#define SOC_1st_CELL_OV_VOLTAGE     4250 //mV
//#define SOC_1st_CELL_UV_VOLTAGE     2500 //mV


#define OCV_TABLE_POINTS 51
#define NUM_OF_OCV_LINE  6

#define RESIDUAL_CAPACITY_INDEX         0
#define RESIDUAL_DSG_1st_CURRENT_INDEX  1
#define RESIDUAL_DSG_2nd_CURRENT_INDEX  2
#define RESIDUAL_DSG_3rd_CURRENT_INDEX  3
#define RESIDUAL_DSG_4th_CURRENT_INDEX  4
#define RESIDUAL_OCV_CURRENT_INDEX      5
#define RESIDUAL_CHG_1st_CURRENT_INDEX  6


/*
; TERMINAL_VOLTAGE units is mV
; RESIDUAL_CAPACITY units is percentage
; Please sort from largest to smallest
// 2600mAh cell, 25 degree, OCV Table
*/

const unsigned int RealOCVTable[OCV_TABLE_POINTS][NUM_OF_OCV_LINE+1] =
{
////////////// RESIDUAL CAPACITY ////////////////////////////////////////////////////////////////
//10.4Ah      1st       2nd      3rd        4th       OCV        1st 
//Capacity,  DSG 5A,  DSG 7.5A,  DSG 10A,  DSG 15A,    OCV,    CHG 2A,     ///////////////////////
//   (%)      (mV)       (mV)      (mV)      (mV)      (mV)      (mV)
    { 100,    41787,    41779,    41777,    41790,    41850,    41864   },   //index = 00       
    { 98 ,    40260,    39699,    39068,    38108,    41616,    41764   },   //index = 01       
    { 96 ,    40004,    39417,    38749,    37718,    41381,    41663   },   //index = 02       
    { 94 ,    39774,    39179,    38504,    37446,    41172,    41560   },   //index = 03       
    { 92 ,    39554,    38957,    38286,    37225,    40969,    41455   },   //index = 04       
    { 90 ,    39342,    38745,    38084,    37031,    40766,    41353   },   //index = 05       
    { 88 ,    39137,    38542,    37893,    36855,    40577,    41256   },   //index = 06       
    { 86 ,    38937,    38346,    37711,    36690,    40389,    41063   },   //index = 07       
    { 84 ,    38744,    38159,    37536,    36534,    40209,    40876   },   //index = 08       
    { 82 ,    38559,    37979,    37368,    36385,    40046,    40702   },   //index = 09       
    { 80 ,    38381,    37806,    37207,    36241,    39874,    40533   },   //index = 10       
    { 78 ,    38209,    37642,    37051,    36102,    39720,    40372   },   //index = 11       
    { 76 ,    38045,    37484,    36901,    35968,    39572,    40221   },   //index = 12       
    { 74 ,    37887,    37333,    36757,    35837,    39426,    40084   },   //index = 13       
    { 72 ,    37736,    37188,    36618,    35710,    39294,    39952   },   //index = 14       
    { 70 ,    37591,    37050,    36484,    35588,    39161,    39832   },   //index = 15       
    { 68 ,    37453,    36918,    36355,    35469,    39043,    39721   },   //index = 16       
    { 66 ,    37321,    36792,    36231,    35355,    38931,    39620   },   //index = 17       
    { 64 ,    37195,    36671,    36112,    35245,    38815,    39530   },   //index = 18       
    { 62 ,    37075,    36556,    35998,    35141,    38722,    39447   },   //index = 19       
    { 60 ,    36962,    36445,    35889,    35041,    38622,    39371   },   //index = 20       
    { 58 ,    36854,    36340,    35786,    34947,    38475,    39301   },   //index = 21       
    { 56 ,    36753,    36240,    35689,    34857,    38286,    39231   },   //index = 22       
    { 54 ,    36658,    36147,    35598,    34773,    38122,    39152   },   //index = 23       
    { 52 ,    36571,    36059,    35513,    34692,    37980,    39071   },   //index = 24       
    { 50 ,    36490,    35977,    35433,    34614,    37895,    39003   },   //index = 25       
    { 48 ,    36414,    35901,    35359,    34538,    37838,    38945   },   //index = 26       
    { 46 ,    36342,    35828,    35288,    34464,    37778,    38895   },   //index = 27       
    { 44 ,    36272,    35759,    35220,    34391,    37755,    38847   },   //index = 28       
    { 42 ,    36202,    35692,    35154,    34319,    37731,    38804   },   //index = 29       
    { 40 ,    36131,    35624,    35088,    34246,    37712,    38763   },   //index = 30       
    { 38 ,    36056,    35555,    35021,    34172,    37696,    38725   },   //index = 31       
    { 36 ,    35976,    35483,    34950,    34097,    37681,    38689   },   //index = 32       
    { 34 ,    35888,    35407,    34876,    34019,    37662,    38655   },   //index = 33       
    { 32 ,    35792,    35324,    34797,    33937,    37645,    38624   },   //index = 34       
    { 30 ,    35686,    35232,    34709,    33851,    37616,    38594   },   //index = 35       
    { 28 ,    35566,    35131,    34612,    33756,    37557,    38566   },   //index = 36       
    { 26 ,    35433,    35016,    34503,    33649,    37526,    38537   },   //index = 37       
    { 24 ,    35286,    34884,    34378,    33526,    37398,    38501   },   //index = 38       
    { 22 ,    35123,    34734,    34234,    33384,    37271,    38443   },   //index = 39       
    { 20 ,    34943,    34563,    34068,    33219,    37118,    38332   },   //index = 40       
    { 18 ,    34743,    34368,    33877,    33036,    36837,    38124   },   //index = 41       
    { 16 ,    34519,    34153,    33676,    32846,    36564,    37762   },   //index = 42       
    { 14 ,    34309,    33959,    33489,    32656,    36264,    37258   },   //index = 43       
    { 12 ,    34134,    33770,    33295,    32453,    35971,    36809   },   //index = 44       
    { 10 ,    33936,    33559,    33081,    32232,    35714,    36490   },   //index = 45       
    { 8  ,    33708,    33324,    32846,    31987,    35511,    36241   },   //index = 46       
    { 6  ,    33422,    33037,    32541,    31652,    35295,    36025   },   //index = 47       
    { 4  ,    32841,    32505,    31947,    31035,    34857,    35767   },   //index = 48       
    { 2  ,    31577,    31256,    30676,    29798,    33775,    34682   },   //index = 49       
    { 0  ,    28926,    28803,    28888,    28563,    31490,    31569   }    //index = 50  
};                                                            




//#define TERMINAL_VOLTAGE_INDEX 0                            
//#define RESIDUAL_CAPACITY_INDEX 1                           
//                                                            
//const int RealOCVTable[OCV_TABLE_POINTS][2] =               
//{                                                           
//  {  4087,  9994  },    //index=00,  1st                    
//  {  3997,  9496  },    //index=01,  2nd                    
//  {  3941,  8998  },    //index=02,  3rd                    
//  {  3890,  8499  },    //index=03,  4th                    
//  {  3843,  8000  },    //index=04,  5th                    
//  {  3800,  7501  },    //index=05,  6th                    
//  {  3761,  7002  },    //index=06,  7th                    
//  {  3727,  6504  },    //index=07,  8th                    
//  {  3695,  6005  },    //index=08,  9th                    
//  {  3666,  5507  },    //index=09,  10th                   
//  {  3641,  5009  },    //index=10,  11th                   
//  {  3618,  4510  },    //index=11,  12th                   
//  {  3596,  4012  },    //index=12,  13th                   
//  {  3572,  3513  },    //index=13,  14th                   
//  {  3544,  3015  },    //index=14,  15th                   
//  {  3511,  2515  },    //index=15,  16th                   
//  {  3473,  2016  },    //index=16,  17th                   
//  {  3432,  1518  },    //index=17,  18th                   
//  {  3381,  1019  },    //index=18,  19th                   
//  {  3299,  521   },    //index=19,  20th                   
//  {  2748,  0     }     //index=20,  21th                   
//};                                                          
                                                              
                                                              
